package com.atguigu.ssyx.client.product;

import com.atguigu.ssyx.model.product.Category;
import com.atguigu.ssyx.model.product.SkuInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author：tzl
 * @Date：2023/11/14 14:39
 */
@FeignClient(value = "service-product")
public interface ProductFeignClient {

    @ApiOperation(value = "根据分类id获取分类信息")
    @GetMapping("/api/product/inner/getCategory/{categoryId}")
    public Category getCategory(@PathVariable Long categoryId);

    @ApiOperation(value = "根据skuId获取sku信息")
    @GetMapping("/api/product/inner/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable("skuId") Long skuId);

    /**
     * 批量获取sku信息
     * @param skuIdList
     * @return
     */
    @ApiOperation(value = "批量获取sku信息")
    @PostMapping("/api/product/inner/findSkuInfoList")
    public List<SkuInfo> findSkuInfoList(@RequestBody List<Long> skuIdList);

    /**
     * 批量获取分类信息
     * @param categoryIdList
     * @return
     */
    @ApiOperation(value = "批量获取sku信息")
    @PostMapping("/api/product/inner/findCategoryInfoList")
    public List<Category> findCategoryInfoList(@RequestBody List<Long> categoryIdList);

    /**
     * 根据关键字获取sku列表
     * @param keyword
     * @return
     */
    @ApiOperation(value = "根据关键字获取sku列表")
    @GetMapping("/api/product/inner/findSkuInfoByKeyword/{keyword}")
    public List<SkuInfo> findSkuInfoByKeyword(@PathVariable("keyword") String keyword);

    /**
     * 更改SkuType
     * @param skuIdList
     * @param seckill
     */
    // @ApiOperation(value = "更改SkuType")
    // @GetMapping("/api/product/inner/updateSkuType")
    // void updateSkuType(List<Long> skuIdList, SkuType seckill);


    /**
     * 获取所有的分类列表
     * @return
     */
    @ApiOperation(value = "获取所有的分类列表")
    @GetMapping("/api/product/inner/findAllCategoryList")
    public List<Category> findAllCategoryList();

    /**
     * 获取新人专享商品列表
     * @return
     */
    @ApiOperation(value = "获取新人专享商品列表")
    @GetMapping("/api/product/inner/findNewPersonSkuInfoList")
    public List<SkuInfo> findNewPersonSkuInfoList();
}
